#!/bin/sh
###
### Job name
#SBATCH --job-name=illumina
### Name of queue to submit to
###SBATCH --partition killing
### Time limit of total run time of the job
###SBATCH --time=20:00:00
### Number of processor cores
#SBATCH -n 1
#SBATCH --error=slurm-%j.err
### The actual job execution

#gunzip ./data/A4-06_AAGCCAAT_L004_R1_001.fastq.gz
#echo 'unzipped'

#python ./scr/reformat_fastq_for_qiime.py ./data/A4-06_AAGCCAAT_L004_R1_001.fastq ./data/A4-06_AAGCCAAT_L004_R1_001.fasta

pick_otus_through_otu_table.py -i ./data/A4-06_AAGCCAAT_L004_R1_001.fasta -o res/AMPA067 -a -O 40


#python /pack/qiime-1.3.0/bin/pick_otus.py -m uclust_ref --suppress_new_clusters --save_uc_files -i ./data/A4-06_AAGCCAAT_L004_R1_001.fasta -r /user/ams/data/gg_4feb2011/repsets/gg_97_otus_4feb2011.fasta -o ./res/AMPA067/ucref_otus/ 
#echo 'picked otus'

#python /pack/qiime-1.3.0/bin/pick_rep_set.py -i ./res/AMPA067/ucref_otus/A4-06_AAGCCAAT_L004_R1_001_otus.txt -f ./data/A4-06_AAGCCAAT_L004_R1_001.fasta --rep_set_picking_method most_abundant -o ./res/AMPA067/repset/A4-06_AAGCCAAT_L004_R1_001_reps.fasta --log_fp ./res/AMPA067/repset/log.txt
#echo 'picked repset'

#python /pack/qiime-1.3.0/bin/assign-taxonomy.py -i ./res/AMPA067/repset/A4-06_AAGCCAAT_L004_R1_001_reps.fasta -t /user/ams/data/gg_4feb2011/tax/greengenes_tax_genus.txt -r /user/ams/data/gg_4feb2011/repsets/gg_97_otus_4feb2011.fasta -o ./res/AMPA067/gg_tax/
echo 'assigned tax'

#python /pack/qiime-1.3.0/bin/make_otu_table.py -i ./res/AMPA067/ucref_otus/A4-06_AAGCCAAT_L004_R1_001_otus.txt -t ./res/AMPA067/gg_tax/A4-06_AAGCCAAT_L004_R1_001_reps_tax_assignments.txt -o ./res/AMPA067/AMPA067_otu_table.txt 
echo 'written otu_table'
echo 'DONE!'